#ifndef _WORLD_MANAGER_
#define _WORLD_MANAGER_

#include <vector>

#include "ITickable.h"
#include "Entity.h"
#include "GameBoard.h"
#include "Common.h"

class WorldManager : public ITickable
{
public:
	WorldManager();
	virtual ~WorldManager();

	bool Initialize(int argc, char **argv);

	void SetGameBoard(GameBoard *gb);

	bool AddEntity(Entity *ent);
	bool RemoveEntity(Entity *ent);
	bool MoveEntity(Entity *ent, MoveDirection dir);

	void Tick();
	void Render();

private:
	std::vector<Entity *> m_entities;

	// weak reference
	GameBoard * m_gameBoard;

	void renderEntities();
	Entity * getEntityAtPosition(const Position &pos);
};

#endif